package dev.loong.boot3.config;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

@Component
public class RedisMessageListener implements MessageListener {
    @Override
    public void onMessage(Message message, byte[] pattern) {
        var body = new String(message.getBody());
        var topic = new String(pattern);
        System.out.println("topic: " + topic + ", body: " + body);
    }
}
